package com.halflife.comeElectricity.batteryCabinet;

import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.generator.build.SimpleBuilder;
import com.halflife.framework.generator.build.UpdataBuilder;
import com.halflife.framework.participant.Department;
import org.junit.jupiter.api.Test;

/**
 * Created by zhaoyf on 2018/6/4.
 */
@QueryAnn(title = "电池柜",mainTitle = "电箱管理",table = "t_batterycabinet")
public class BatteryCabinet {
    @Test
    public void generate0()throws Exception{
        SimpleBuilder builder = new SimpleBuilder();
        builder.buildAll(this.getClass());
    }
    @Test
    public void generate()throws Exception{
        UpdataBuilder builder = new UpdataBuilder();
        builder.buildMapper(this.getClass());
    }
    private enum BatteryCabinetStatus {
        NORMAL, ERROR
    }
    private Integer id;
    @QueryAnn(value = "编码", operate = "like", refered=true)
    private String no;
    @QueryAnn(value = "名称", operate = "like",refered=true)
    private String name;
    @QueryAnn(value = "经度")
    private Double longitude;
    @QueryAnn(value = "纬度")
    private Double latitude;
    @QueryAnn(value = "地址",operate = "like")
    private String address;
    @QueryAnn(value = "备注")
    private String memo;
    @QueryAnn(value = "状态")
    private Integer status;
    @QueryAnn(value = "是否有效",refered=true)
    private Boolean valid;
    @QueryAnn(value = "访问地址")
    private String serverUrl;
    @QueryAnn(value = "DepartmentId",refered = true)
    private Integer departmentId;
    @QueryAnn(value = "Department",refered = true)
    @Join()
    private Department department;

    @QueryAnn(persist = false)
    private Integer count;

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public void init() {
        this.setValid(Boolean.TRUE);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }
}
